﻿using StoreProject.Enum;
using StoreProject.Properties;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace StoreProject.Forms.UserControls
{
    public partial class ConfigToolButton : ToolStripButton
    {
        public ConfigToolButton()
        {
            InitializeComponent();
        }

        public ConfigToolButton(ConfigButtonType type)
        {
            InitializeComponent();
            this.TextImageRelation = TextImageRelation.TextBeforeImage;
            this.RightToLeft = RightToLeft.Yes;
            this.ForeColor = Color.FromArgb(255, 121, 190, 60);
            this.AutoSize = false;
            this.Width = 70;
            this.Height = 25;
            this.Tag = type;
            this.Name = type.ToString();
            switch (type)
            {
                case ConfigButtonType.ADD:
                    //this.Image = Resource.SETTING_ADD;
                    this.Text = "新增";
                    break;
                case ConfigButtonType.UPDATE:
                    //this.Image = Resource.SETTING_UPDATE;
                    this.Text = "修改";
                    break;
                case ConfigButtonType.DELETE:
                    //this.Image = Resource.SETTING_DELETE;
                    this.Text = "删除";
                    break;
                case ConfigButtonType.SAVE:
                    //this.Image = Resource.SETTING_SAVE;
                    this.Text = "保存";
                    break;
                case ConfigButtonType.CANCEL:
                    //this.Image = Resource.SETTING_CANCEL;
                    this.Text = "取消";
                    break;
                case ConfigButtonType.QUERY:
                    //this.Image = Resource.SETTING_QUERY;
                    this.Text = "查询";
                    break;
                case ConfigButtonType.PRINT:
                    //this.Image = Resource.SETTING_PRINT;
                    this.Text = "打印";
                    break;
                case ConfigButtonType.EXPORT:
                    //this.Image = Resource.SETTING_EXPORT;
                    this.Text = "导出";
                    break;
                case ConfigButtonType.EXIT:
                    //this.Image = Resource.SETTING_EXIT;
                    this.Text = "关闭";
                    break;
                default:
                    break;
            }
        }
    }
}
